package com.sgzn.sgpay.service.tcp.model;

import com.sgzn.sgpay.service.tcp.SgTcpProtocolHead;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

/**
 * Created by xxjs-gd-llf
 * DATETIME:2018/4/11 23:37
 * Description: 服务器应答登陆成功
 */
@Setter
@Getter
public class TcpLoginCheckResponse {

    private  String beginCode ;

    private String commandCode;


    @NotBlank
    private String deviceId;

    /**
     * 0x00 成功
     0x01 认证码校验失败
     0x02 设备未注册
     0x03 其他原因
     */
    @NotBlank
   private String checkStat;

    private String checkTime;

    @NotBlank
    private String checkSumCode;

    private   String endCode;

    @Override
    public String toString(){
        //根据协议规范重载toString方法
        return      beginCode+ SgTcpProtocolHead.TCP_SEND_SEPERATOR+
                    commandCode + SgTcpProtocolHead.TCP_SEND_SEPERATOR+
                    deviceId + SgTcpProtocolHead.TCP_SEND_SEPERATOR+
                    checkStat + SgTcpProtocolHead.TCP_SEND_SEPERATOR+
                    checkTime  + SgTcpProtocolHead.TCP_SEND_SEPERATOR+
                    checkSumCode + SgTcpProtocolHead.TCP_SEND_SEPERATOR+
                    endCode;
    }

}
